<?php
class feedback_edit extends SClass {

    public function process() {
        try {
            $post = ServiceUtils::GetFactory()->getFeedbackService()->getFeedbackByID(
                $this->getArgument('id')
            );
            if ($this->getControlValue('ok')) {
            	ServiceUtils::GetFactory()->getFeedbackService()->editFeedback(
            	   $post->getId(),
            	   $this->getControlValue('title'),
            	   $this->getControlValue('content'),
                    $this->getControlValue('name'),
                     1
            	);
            	$this->assign('message', 'ok');
            	$this->assign('urlredirect',
            	   Engine_LinkMaker::GetURLByContentID('controlpanel-feedback_viewP',
            	   $post->getId())
            	);
            } else {
                $this->setControlValue('title', $post->getTitle());
                $this->setControlValue('content', $post->getContent());
                $this->setControlValue('name', $post->getName());
           //     $this->getControlValue('chek', $post->getBlessed());
                
            }
        } catch (ServiceUtils_Exception  $e) {
            $this->assign('errors', $e->getErrors());
        }
    }

}